package com.sls.game.dao.xinhe.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.sls.game.dao.impl.SuperDAO;
import com.sls.game.dao.xinhe.XinHeAccountDAO;
import com.sls.game.pojo.xinhe.XinHeAccount;

@Repository("xinHeAccountDAO")
public class XinHeAccountDAOImpl extends SuperDAO<XinHeAccount> implements
		XinHeAccountDAO {

	@Override
	public void insert(XinHeAccount account) {
		this.getSqlSession().insert("mybatis.xml.XinHeAccountMapper.insert",
				account);
	}

	@Override
	public void update(XinHeAccount account) {
		this.getSqlSession().insert("mybatis.xml.XinHeAccountMapper.update",
				account);
	}

	@Override
	public XinHeAccount queryByAccountId(XinHeAccount account) {
		return this.getSqlSession().selectOne(
				"mybatis.xml.XinHeAccountMapper.queryByAccountId", account);
	}

	@Override
	public XinHeAccount queryByAccountName(XinHeAccount account) {
		return this.getSqlSession().selectOne(
				"mybatis.xml.XinHeAccountMapper.queryByAccountName", account);
	}

	@Override
	public List<String> queryAccNameByCompanyId(String companyId) {
		List<String> list = this
				.getSqlSession()
				.selectList(
						"mybatis.xml.XinHeAccountMapper.queryAccNameByCompanyId",
						companyId);
		return list;
	}

}
